<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>for循环 | 个人笔记</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-expandable-chapters-interactive/expandable-chapters.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../../md/js/js多层循环.html" />
    
    
    <link rel="prev" href="../../md/js/jswhile循环.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="3.3.2"
        data-chapter-title="for循环"
        data-filepath="md/js/jsfor循环.md"
        data-basepath="../.."
        data-revision="Fri Sep 14 2018 16:41:08 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="md/html/HTML5.html">
            
                
                    <a href="../../md/html/HTML5.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        HTML介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2" data-path="md/css/CSS笔记.html">
            
                
                    <a href="../../md/css/CSS笔记.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        css笔记
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3" data-path="md/js/js基础.html">
            
                
                    <a href="../../md/js/js基础.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        JavaScript
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="md/js/js数据类型的转换.html">
            
                
                    <a href="../../md/js/js数据类型的转换.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        数据类型
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="md/js/js运算符.html">
            
                
                    <a href="../../md/js/js运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        运算符
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.2.1" data-path="md/js/js赋值运算符.html">
            
                
                    <a href="../../md/js/js赋值运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.1.</b>
                        
                        赋值运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2.2" data-path="md/js/js比较运算符.html">
            
                
                    <a href="../../md/js/js比较运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.2.</b>
                        
                        比较运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2.3" data-path="md/js/js逻辑操作符.html">
            
                
                    <a href="../../md/js/js逻辑操作符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.3.</b>
                        
                        逻辑操作符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2.4" data-path="md/js/js条件运算符.html">
            
                
                    <a href="../../md/js/js条件运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.4.</b>
                        
                        条件运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2.5" data-path="md/js/js位运算符.html">
            
                
                    <a href="../../md/js/js位运算符.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.5.</b>
                        
                        位运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2.6" data-path="md/js/js条件语句.html">
            
                
                    <a href="../../md/js/js条件语句.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.6.</b>
                        
                        条件语句
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="md/js/js循环.html">
            
                
                    <a href="../../md/js/js循环.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        循环
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.3.1" data-path="md/js/jswhile循环.html">
            
                
                    <a href="../../md/js/jswhile循环.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.1.</b>
                        
                        while循环
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="3.3.2" data-path="md/js/jsfor循环.html">
            
                
                    <a href="../../md/js/jsfor循环.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.2.</b>
                        
                        for循环
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3.3" data-path="md/js/js多层循环.html">
            
                
                    <a href="../../md/js/js多层循环.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.3.</b>
                        
                        多层循环
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="md/js/js函数.html">
            
                
                    <a href="../../md/js/js函数.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.</b>
                        
                        函数
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="md/js/js冒泡排序.html">
            
                
                    <a href="../../md/js/js冒泡排序.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.5.</b>
                        
                        冒泡排序
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="md/js/try-catch语句.html">
            
                
                    <a href="../../md/js/try-catch语句.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.6.</b>
                        
                        try-catch语句
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="md/js/jses6.html">
            
                
                    <a href="../../md/js/jses6.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.7.</b>
                        
                        es6
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.7.1" data-path="md/js/安装babel.html">
            
                
                    <a href="../../md/js/安装babel.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.7.1.</b>
                        
                        安装babel(es6转es5)
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.8" data-path="md/js/js数组对象.html">
            
                
                    <a href="../../md/js/js数组对象.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.8.</b>
                        
                        数组对象
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="md/js/js笔记.html">
            
                
                    <a href="../../md/js/js笔记.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        js大佬de笔记
                    </a>
            
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../" >个人笔记</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h3 id="for&#x5FAA;&#x73AF;">for&#x5FAA;&#x73AF;</h3>
<h4 id="1for&#x5FAA;&#x73AF;">1.for&#x5FAA;&#x73AF;</h4>
<pre><code>&#x8BED;&#x6CD5;&#xFF1A;
for(&#x8BED;&#x53E5;&#x4E00;&#xFF1B;&#x8BED;&#x53E5;&#x4E8C;&#xFF1B;&#x8BED;&#x53E5;&#x4E09;){
    &#x9700;&#x8981;&#x5FAA;&#x73AF;&#x6267;&#x884C;&#x7684;&#x5185;&#x5BB9;
}
1.&#x8BED;&#x53E5;&#x4E00;&#xFF1A;&#x521D;&#x59CB;&#x5316;&#x6761;&#x4EF6;&#x5224;&#x65AD;&#x7684;&#x521D;&#x59CB;&#x503C;
2.&#x8BED;&#x53E5;&#x4E8C;&#xFF1A;&#x6761;&#x4EF6;&#x5224;&#x65AD;&#x8BED;&#x53E5;
3.&#x8BED;&#x53E5;&#x4E09;&#xFF1A;&#x521D;&#x59CB;&#x503C;&#x7684;&#x81EA;&#x589E;&#x91CF;

&#x5FAA;&#x73AF;&#x8FC7;&#x7A0B;&#xFF1A;&#x5148;&#x8FDB;&#x884C;&#x6761;&#x4EF6;&#x5224;&#x65AD;&#xFF0C;&#x4E3A;true&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x8FDB;&#x5165;&#x5FAA;&#x73AF;&#x4F53;(&#x5927;&#x62EC;&#x53F7;&#x91CC;&#x9762;&#x7684;&#x5185;&#x5BB9;),
&#x6267;&#x884C;&#x6211;&#x4EEC;&#x5B9A;&#x4E49;&#x7684;&#x4EE3;&#x7801;&#xFF0C;&#x7136;&#x540E;&#x8FDB;&#x884C;&#x81EA;&#x589E;&#xFF0C;&#x81EA;&#x589E;&#x4E4B;&#x540E;&#x53C8;&#x8FDB;&#x5165;&#x6761;&#x4EF6;&#x5224;&#x65AD;&#x8BED;&#x53E5;&#xFF0C;&#x4E3A;true&#x7684;&#x65F6;&#x5019;&#xFF0C;
&#x53C8;&#x8FDB;&#x5165;&#x5FAA;&#x73AF;&#x4F53;&#xFF0C;&#x6267;&#x884C;&#x5B9A;&#x4E49;&#x7684;&#x4EE3;&#x7801;&#xFF0C;&#x7136;&#x540E;&#x53C8;&#x8FDB;&#x884C;&#x81EA;&#x589E;&#xFF0C;
&#x81EA;&#x589E;&#x4E4B;&#x540E;&#x518D;&#x6B21;&#x8FDB;&#x5165;&#x5224;&#x65AD;&#x8BED;&#x53E5;&#x3002;&#x3002;&#x3002;&#x5982;&#x6B64;&#x5F80;&#x8FD4;&#x5FAA;&#x73AF;&#xFF0C;&#x76F4;&#x5230;&#x6761;&#x4EF6;&#x5224;&#x65AD;&#x4E3A;false&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x8DF3;&#x51FA;&#x5FAA;&#x73AF;&#x3002;

&#x4ECE;1&#x52A0;&#x5230;10
var j = 0;
for(var i=1;i&lt;=10;i++){
    j = j+i;
    console.log(i);
}
console.log(j);
</code></pre>
                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../../md/js/jswhile循环.html" class="navigation navigation-prev " aria-label="Previous page: while循环"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../../md/js/js多层循环.html" class="navigation navigation-next " aria-label="Next page: 多层循环"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../../gitbook/app.js"></script>

    
    <script src="../../gitbook/plugins/gitbook-plugin-expandable-chapters-interactive/expandable-chapters.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"expandable-chapters-interactive":{},"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"livereload":{}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
